﻿using System;
using System.Linq;

namespace NuSoft.SistemaGestionPersonal.WinFormsUI
{
    public static class UtilityExtensions
    {
        public static bool Contains(this string source, string value, StringComparison comparisonType)
        {
            return source.IndexOf(value, comparisonType) >= 0;
        }

        public static bool IsAlpha(this string source)
        {
            return source.ToCharArray().All(@char => char.IsLetter(@char));
        }

        public static bool IsNumericOrWhiteSpace(this string source)
        {
            return source.ToCharArray().All(@char => char.IsDigit(@char) || char.IsWhiteSpace(@char));
        }
    }
}